if(COMMAND cmake_policy)
      cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)


ADD_EXECUTABLE( 2dweave 2dweave.cpp)
ADD_EXECUTABLE( 3dweave 3dweave.cpp)
ADD_EXECUTABLE( cotton cotton.cpp)
ADD_EXECUTABLE( polyester polyester.cpp)


IF(BUILD_RENDERER)
    FIND_PACKAGE(VTK REQUIRED)
    INCLUDE_DIRECTORIES(${VTK_INCLUDE_DIRS})
ENDIF(BUILD_RENDERER)

TARGET_LINK_LIBRARIES(2dweave TexGenCore  )
TARGET_LINK_LIBRARIES(3dweave TexGenCore  )
TARGET_LINK_LIBRARIES(cotton 	TexGenCore  )
TARGET_LINK_LIBRARIES(polyester TexGenCore  )

IF(BUILD_RENDERER)
	ADD_DEFINITIONS(-DUSE_RENDERER)
	TARGET_LINK_LIBRARIES(2dweave  TexGenRenderer)
	TARGET_LINK_LIBRARIES(3dweave  TexGenRenderer)
	TARGET_LINK_LIBRARIES(cotton 	 TexGenRenderer)
	TARGET_LINK_LIBRARIES(polyester  TexGenRenderer)
ENDIF(BUILD_RENDERER)

IF(UNIX)
	SET_TARGET_PROPERTIES(2dweave PROPERTIES 			COMPILE_FLAGS -Wno-deprecated)
	SET_TARGET_PROPERTIES(3dweave PROPERTIES			COMPILE_FLAGS -Wno-deprecated)
	SET_TARGET_PROPERTIES(cotton PROPERTIES 			COMPILE_FLAGS -Wno-deprecated)
	SET_TARGET_PROPERTIES(polyester PROPERTIES 			COMPILE_FLAGS -Wno-deprecated)
ENDIF(UNIX)
